import Taro from "@tarojs/taro"
/**
 * 云开资源发地址
 */
export const CLOUD_BASE_URL = 'https://7a68-zhexu-0gfshy7t6d314f47-1306108795.tcb.qcloud.la/'
/**
 * 需要初始加载的资源
 */
export const LOAD_RESOURCES = {
  loadingImg: [
    `${CLOUD_BASE_URL}images/start-game-2.png`,
    `${CLOUD_BASE_URL}images/start-game-1.png`
  ]
}
export const request = (link) => {
  return Taro.request({
    url: link
  })
}
/**
 * 加载资源
 */
export const loadResource = (resource = LOAD_RESOURCES) => {
  Object.values(resource).forEach(list => {
    list.forEach(link => {
      request(link)
    })
  })
}
